<template>
  <view>
    <!-- <view>接单页面跳转中...</view> -->
  </view>
</template>

<script>
  import func from '@/utils/funlogin.js';
  import { getAccountIdentity, getDriverId } from '@/utils/auth.js';
  import {
    getAccessToken,
    setTenantId,
    removeWayBillNo,
    getTenantId,
    setToken,
    setDriverId,
    setOpenId
  } from '@/utils/auth';
  import {
    getOpenIdByCode,
    getTenantsByOpenId,
    getPhoneByOpenid,
    wxPhoneLogin
  } from '@/api/login.js';
  import { toast } from '@/utils/common.js';
  import { getDriving } from '@/api/me.js';
  export default {
    data() {
      return {
        isLogin: false,
        privacyShow: false,
        tenantId: null,
        tenantList: [],
        openid: '',
        dataSource: 0 //0:系统自建 1:集运2.0
      };
    },
    setOpenShare: function (data) {
      // let that = this;
      // if (that.$wechat.isWeixin()) {
      //   let configAppMessage = {
      //     desc: data.synopsis,
      //     title: data.title,
      //     link: location.href,
      //     imgUrl: data.img
      //   };
      //   that.$wechat.wechatEvevt(
      //     ['updateAppMessageShareData', 'updateTimelineShareData'],
      //     configAppMessage
      //   );
      // }
    },
    onLoad(options) {
      if (!!options) {
        if (!!options.types) {
          if (options.types === 'coalder') {
            //装车工
            if (getAccountIdentity() !== 0) {
              uni.reLaunch({
                url: '/pages/login'
              });
            } else {
              if (!!options.userId) {
                if (getDriverId() == options.userId) {
                  uni.reLaunch({
                    url: '/pages/devices/working'
                  });
                } else {
                  uni.reLaunch({
                    url: '/pages/login'
                  });
                }
              }
            }
          } else {
            //企业端
            if (getAccountIdentity() !== 1 || getAccountIdentity() !== 2) {
              uni.reLaunch({
                url: '/pages/login'
              });
            } else {
              if (!!options.userId) {
                if (getDriverId() == options.userId) {
                  uni.reLaunch({
                    url: '/pages/index'
                  });
                } else {
                  uni.reLaunch({
                    url: '/pages/login'
                  });
                }
              }
            }
          }
        }
      }
    },
    onShow() {
    },
    onHide() { },
    methods: {

    }
  };
</script>

<style lang="scss"></style>